package com.cs.service;

import com.cs.dao.StudentDao;
import com.cs.entity.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentService {
    @Autowired
    private StudentDao studentDao;

    public List<Student> selectAll(){
        return studentDao.selectAll();
    }
    public Student selectId(int id){
        return studentDao.SelectId(id);
    }
    public String deleteId(int id){
        return studentDao.deleteId(id)>0?"成功":"失败";
    }
    public String input(Student student){
        return studentDao.Insert(student)>0?"成功":"失败";
    }
    public String update(Student student){
        return studentDao.update(student)>0?"成功":"失败";
    }
}
